﻿<%@ Page Title="Equivalências" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="CadastroEquivalencia.aspx.cs" Inherits="AcadPosApp.Cadastros.CadastroEquivalencia" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script>
    function aviso() {

        var some_html = '<img src="../Imagens/alertaAviso.png" width="100px"/><br />';

        some_html += '<h2>ATENÇÃO!</h2><br />';
        some_html += '<h4>As cargas horárias das disciplinas são diferentes!</h4>'
        //some_html += '<h4>' + msg.toString() + '</h4>';
        //some_html += '<h4>' + msg2 + '</h4>';
        bootbox.alert(some_html);      
    }
</script>
    <style type="text/css">
        .style1
        {
            width: 610px;
        }
        .style2
        {
            width: 83px;
        }
        .style3
        {
            width: 126px;
        }
        .style6
        {
            width: 337px;
        }
        .style12
        {
            width: 301px;
        }
        .style14
        {
            width: 396px;
        }
        .style15
        {
            width: 298px;
        }
        .style16
        {
            width: 310px;
        }
    .style17
    {
        width: 309px;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="pnlPesquisa" runat="server" GroupingText="Consulta de Cursos">
        <table class="style1">
            <tr>
                <td colspan="2">
                    Áreas de Conhecimento<br />
                    <asp:DropDownList ID="ddlAreaConhecimento" runat="server" AutoPostBack="True" 
                        OnSelectedIndexChanged="ddlAreaConhecimento_SelectedIndexChanged" Width="300px">
                    </asp:DropDownList>
                </td>
                <td class="style3">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style16">
                    Descrição
                    <br />
                    <asp:TextBox ID="txtPesquisa" runat="server" MaxLength="250" Width="300px"></asp:TextBox>
                </td>
                <td>
                    <br />
                    <asp:Button ID="btnConsultar" runat="server" formnovalidate="formnovalidate" 
                        OnClick="btnConsultar_Click" Text="Consultar" ValidationGroup="pesquisa" 
                        Width="100px" />
                </td>
                <td class="style3">
                    <br />
                </td>
            </tr>
        </table>
        <br />
        

        <asp:GridView ID="gvwPesquisa" runat="server" AutoGenerateColumns="False" CssClass="mGrid"
            DataKeyNames="ID_CURSO" EmptyDataText="Dados não localizados..." GridLines="Vertical"
            Width="45%" OnRowDataBound="gvwPesquisa_RowDataBound" AllowPaging="True" OnPageIndexChanging="gvwPesquisa_PageIndexChanging"
            OnSelectedIndexChanged="gvwPesquisa_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True">
                    <ItemStyle Width="1%" />
                </asp:CommandField>
                <asp:BoundField DataField="ID_CURSO" HeaderText="Código">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="DESCRICAO" HeaderText="Cursos">
                    <ItemStyle HorizontalAlign="Left" Width="75%" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Status">
                    <ItemTemplate>
                        <asp:Image ID="imgStatus" runat="server" Height="25px" Width="25px" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:BoundField DataField="SITUACAO" HeaderText="Situação">
                    <ItemStyle Width="10%" HorizontalAlign="Center" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <br />
        <table class="style1">
            <tr>
                <td class="style2">
                    Currículo<br />
                    <asp:DropDownList ID="ddlCurriculoPesquisa" runat="server" AutoPostBack="True" Enabled="false"
                        OnSelectedIndexChanged="ddlCurriculoPesquisa_SelectedIndexChanged" 
                        Width="300px">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
        <table class="style1">
            <tr>
                <td class="style12">
                    Módulo<br />
                    <asp:DropDownList ID="ddlModuloPesquisa" runat="server" AutoPostBack="True" 
                        Enabled="False" OnSelectedIndexChanged="ddlModuloPesquisa_SelectedIndexChanged" 
                        Width="300px">
                    </asp:DropDownList>
                </td>
                <td class="style6">
                    <br />
                    &nbsp;<asp:Button ID="btnConsultarDisciplinas" runat="server" 
                        OnClick="btnConsultarDisciplinas_Click" Text="Consultar" Width="100px" />
                </td>
            </tr>
        </table>
        <br />
        </asp:Panel>
    <br />
        <asp:Panel ID="pnlPesquisaDisciplinas" runat="server" GroupingText="Disciplinas do Módulo"
            Visible="False">
            <asp:GridView ID="gvwPesquisaDisciplinas" runat="server" AutoGenerateColumns="False"
                CssClass="mGrid" DataKeyNames="ID_MATRIZ_CURRICULAR, ID_DISCIPLINA, ID_MODULO_CURRICULO"
                EmptyDataText="Dados não localizados..." GridLines="Vertical" 
                Width="900px" AllowPaging="True"
                OnPageIndexChanging="gvwPesquisaDisciplinas_PageIndexChanging" 
                OnSelectedIndexChanged="gvwPesquisaDisciplinas_SelectedIndexChanged">
                <AlternatingRowStyle BackColor="#D3D3D3" />
                <Columns>
                    <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" 
                        ShowSelectButton="True">
                        <ItemStyle Width="1%" />
                    </asp:CommandField>
                    <asp:BoundField DataField="ORDEM_MINISTRACAO" HeaderText="Ordem">
                        <HeaderStyle HorizontalAlign="Center" Width="1%" />
                        <ItemStyle HorizontalAlign="Center" Width="1%" />
                    </asp:BoundField>
                    <asp:BoundField DataField="DESCRICAO_DISCIPLINA" HeaderText="Disciplina">
                        <HeaderStyle HorizontalAlign="Center" Width="80%" />
                        <ItemStyle HorizontalAlign="Left" Width="80%" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CH_DISCIPLINA" HeaderText="C.H.">
                        <HeaderStyle HorizontalAlign="Center" Width="1%" />
                        <ItemStyle HorizontalAlign="Center" Width="1%" />
                    </asp:BoundField>
                </Columns>
                <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#808080" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#383838" />
            </asp:GridView>
            <br />
    </asp:Panel>
    <br />
            <asp:Panel ID="pnlEquivalenciasCadastradas" runat="server" 
                GroupingText="Equivalentes Cadastradas" Visible="False">
                <asp:GridView ID="gvwEquivalenciasDisciplinas" runat="server" 
                    AllowPaging="True" AutoGenerateColumns="False" CssClass="mGrid" 
                    DataKeyNames="ID_MATRIZ_CURRICULAR_DISC, ID_MATRIZ_CURRICULAR_EQUIVALENTE, ID_EQUIVALENCIA" 
                    EmptyDataText="Dados não localizados..." GridLines="Vertical" 
                    OnPageIndexChanging="gvwEquivalenciasDisciplinas_PageIndexChanging" 
                    OnRowCommand="gvwEquivalenciasDisciplinas_RowCommand" 
                    OnRowCreated="gvwEquivalenciasDisciplinas_RowCreated" 
                    OnRowDataBound="gvwEquivalenciasDisciplinas_RowDataBound" Width="900px">
                    <AlternatingRowStyle BackColor="#D3D3D3" />
                    <Columns>
                        <asp:TemplateField HeaderText="Excluir" ShowHeader="False">
                            <ItemTemplate>
                                <abbr title="Excluir">
                                <asp:ImageButton ID="Excluir" runat="server" CausesValidation="false" 
                                    CommandName="Excluir" formnovalidate="formnovalidate" 
                                    ImageUrl="~/Imagens/delete.png" 
                                    OnClientClick="return ShowConfirm('Tem certeza que deseja excluir?', this.ID);" 
                                    Text="Excluir" Width="20px" />
                                </abbr>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="ORDEM_MINISTRACAO" HeaderText="Ordem">
                        <HeaderStyle HorizontalAlign="Center" Width="1%" />
                        <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DESCRICAO_DISCIPLINA" HeaderText="Disciplina">
                        <HeaderStyle HorizontalAlign="Center" Width="80%" />
                        <ItemStyle HorizontalAlign="Left" Width="80%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CH_DISCIPLINA" HeaderText="C.H.">
                        <HeaderStyle HorizontalAlign="Center" Width="10%" />
                        <ItemStyle HorizontalAlign="Left" Width="10%" />
                        </asp:BoundField>
                    </Columns>
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />
                </asp:GridView>
                <br />
                <asp:Button ID="btnInserir" runat="server" formnovalidate="formnovalidate" 
                    OnClick="btnInserir_Click" Text="Inserir" Width="100px" />
                <br /><br />
            </asp:Panel>
            <br />
    <asp:Panel ID="pnlCadastro" runat="server" 
        GroupingText="Cadastro de Disciplinas Equivalentes" Visible="False">
        <table class="style1">
            <tr>
                <td class="style17">
                    Áreas de Conhecimento
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style17">
                    <asp:DropDownList ID="ddlCadAreaConhecimento" runat="server" Width="300px" AutoPostBack="True"
                        OnSelectedIndexChanged="ddlCadAreaConhecimento_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style17">
                    Descrição
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style17">
                    <asp:TextBox ID="txtCadPesquisa" runat="server" required="required" 
                        MaxLength="250" Width="300px"></asp:TextBox>
                    <!-- <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCadPesquisa"
                        ErrorMessage="É necessário preencher o campo pesquisa!" ForeColor="Red" ValidationGroup="cadPesquisa"
                        SetFocusOnError="True">*</asp:RequiredFieldValidator> -->
                </td>
                <td>
                    &nbsp;<asp:Button ID="btnCadConsultar" runat="server" OnClick="btnCadConsultar_Click"
                        Text="Consultar" ValidationGroup="cadPesquisa" Width="100px" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="gvwCadPesquisa" runat="server" AutoGenerateColumns="False" CssClass="mGrid"
            DataKeyNames="ID_CURSO" EmptyDataText="Dados não localizados..." GridLines="Vertical"
            Width="45%" OnRowDataBound="gvwCadPesquisa_RowDataBound" 
            AllowPaging="True" OnPageIndexChanging="gvwCadPesquisa_PageIndexChanging"
            OnSelectedIndexChanged="gvwCadPesquisa_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True">
                    <ItemStyle Width="1%" />
                </asp:CommandField>
                <asp:BoundField DataField="ID_CURSO" HeaderText="Código">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="DESCRICAO" HeaderText="Cursos">
                    <ItemStyle HorizontalAlign="Left" Width="75%" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Status">
                    <ItemTemplate>
                        <asp:Image ID="imgStatus" runat="server" Height="25px" Width="25px" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:BoundField DataField="SITUACAO" HeaderText="Situação">
                    <ItemStyle Width="10%" HorizontalAlign="Center" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <br />
        <table class="style1">
            <tr>
                <td class="style2">
                    Currículo<br />
                    <asp:DropDownList ID="ddlCadCurriculoPesquisa" runat="server" 
                        AutoPostBack="True" Enabled="false" 
                        OnSelectedIndexChanged="ddlCadCurriculoPesquisa_SelectedIndexChanged" 
                        Width="300px">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
        <table class="style1">
            <tr>
                <td class="style15">
                    Módulo<br />
                    <asp:DropDownList ID="ddlCadModuloPesquisa" runat="server" AutoPostBack="True" 
                        Enabled="False" 
                        OnSelectedIndexChanged="ddlCadModuloPesquisa_SelectedIndexChanged" 
                        Width="300px">
                    </asp:DropDownList>
                </td>
                <td class="style6">
                    <br />
                    &nbsp;
                    <asp:Button ID="btnCadConsultarDisciplinas" runat="server" 
                        OnClick="btnCadConsultarDisciplinas_Click" Text="Consultar" 
                        Width="100px" />
                </td>
            </tr>
        </table>
        <br />
        <asp:Panel ID="pnlCadDisciplinasModulo" runat="server" GroupingText="Disciplinas do Módulo"
            Visible="False">
            <asp:GridView ID="gvwCadPesquisaDisciplinas" runat="server" AutoGenerateColumns="False"
                CssClass="mGrid" DataKeyNames="ID_MATRIZ_CURRICULAR, ID_DISCIPLINA, ID_MODULO_CURRICULO"
                EmptyDataText="Dados não localizados..." GridLines="Vertical" 
                Width="45%" AllowPaging="True"
                OnPageIndexChanging="gvwCadPesquisaDisciplinas_PageIndexChanging" 
                onselectedindexchanged="gvwCadPesquisaDisciplinas_SelectedIndexChanged">
                <AlternatingRowStyle BackColor="#D3D3D3" />
                <Columns>
                    <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True">
                        <ItemStyle Width="1%" />
                    </asp:CommandField>
                    <asp:BoundField DataField="ORDEM_MINISTRACAO" HeaderText="Ordem">
                        <HeaderStyle HorizontalAlign="Center" Width="1%" />
                        <ItemStyle HorizontalAlign="Center" Width="1%" />
                    </asp:BoundField>
                    <asp:BoundField DataField="DESCRICAO_DISCIPLINA" HeaderText="Disciplina">
                        <HeaderStyle HorizontalAlign="Center" Width="80%" />
                        <ItemStyle HorizontalAlign="Left" Width="80%" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CH_DISCIPLINA" HeaderText="C.H.">
                        <HeaderStyle HorizontalAlign="Center" Width="10%" />
                        <ItemStyle HorizontalAlign="Left" Width="10%" />
                    </asp:BoundField>
                </Columns>
                <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#808080" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#383838" />
            </asp:GridView>
        </asp:Panel>
        <br />
        <div class="legenda">
            <asp:Button ID="btnConfirmar" runat="server" Text="Confirmar" ValidationGroup="cadastro"
                OnClick="btnConfirmar_Click" Width="100px" />
            &nbsp;<asp:Button ID="btnCancelar" formnovalidate="formnovalidate" 
                runat="server" Text="Cancelar"
                OnClick="btnCancelar_Click" Width="100px" />
        </div><br />
    </asp:Panel>
</asp:Content>
